package com.braveman.im.ui.activity;

import android.content.Intent;

import com.braveman.im.R;
import com.ht.baselibs.ui.base.BaseActivity;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.easeui.EaseConstant;
import com.hyphenate.easeui.ui.EaseChatFragment;
import com.hyphenate.easeui.widget.EaseChatMessageList;

public class ChartNewActivity extends BaseActivity {
    private EaseChatFragment chatFragment;
    private EaseChatMessageList messageList;
    private String mChatId;

    @Override
    protected boolean isStaticPage() {
        return true;
    }

    @Override
    protected void initTitleBar() {
        mTitleBarView.setTitleText("聊天");
    }

    @Override
    protected void initIntentData(Intent callIntent) {
        mChatId = getIntent().getStringExtra("ec_chat_id");
    }

    @Override
    protected int initContentView() {
        return R.layout.activity_chat_frag;
    }

    @Override
    protected void initChildView() {
        messageList = (EaseChatMessageList) findViewById(R.id.message_list);
//初始化messagelist
        messageList.init(mChatId, EaseConstant.CHATTYPE_CHATROOM, null);
//设置item里的控件的点击事件
        messageList.setItemClickListener(new EaseChatMessageList.MessageListItemClickListener() {

            @Override
            public void onUserAvatarClick(String username) {
                //头像点击事件
            }

            @Override
            public void onUserAvatarLongClick(String username) {

            }

            @Override
            public void onResendClick(final EMMessage message) {
                //重发消息按钮点击事件
            }

            @Override
            public void onBubbleLongClick(EMMessage message) {
                //气泡框长按事件
            }

            @Override
            public boolean onBubbleClick(EMMessage message) {
                //气泡框点击事件，EaseUI有默认实现这个事件，如果需要覆盖，return值要返回true
                return false;
            }
        });

    }

    @Override
    protected void initChildData() {

    }

    @Override
    protected void setChildViewListener() {

    }
}
